<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="i1" class="c1">你好</div>
    <script>
        // 通过document.getElementById方式湖区div这个标签
        var i1 = document.getElementById("i1")

        /* 添加获取是修改 */
        // i1.setAttribute("style","color:red")
        // i1.setAttribute("class","c2")

        // i1.removeAttribute("class")

        /* 获取属性 */
        // var cc = i1.getAttribute("class")
        // console.log(cc);
    </script>
</body>
</html>